<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>event prevent and capture and self once</title>
    <script src="../../vue.js"></script>
    <style>
        .Odiv1{
            width: 80px;
            height: 80px;
            background: #aaa;
            margin: 5px;
        }
         .Odiv2{
            width: 50px;
            height: 50px;
            background: #ccc;
        }   
    </style>
</head>
<body>
    <div id="app">
        <a href="http://www.baidu.com">baidu</a>
        <a href="http://www.baidu.com" v-on:click.prevent>prevent baidu</a>


        <div v-on:click.capture.once="doParent">
            <button v-on:click="doThis">event capture</button>
        </div>

        <div class="Odiv1" v-on:click.self="doParent">a
            <div class="Odiv2" v-on:click="doThis">
                b
            </div>
        </div>
        <div class="Odiv1" v-on:click="doParent">c
            <div class="Odiv2" v-on:click.self="doThis">
                d
            </div>
        </div>
    </div> 
    <script>
        var vm=new Vue({
            el:'#app',
            methods:{
                doParent(){
                    console.log("it is parent event")
                },
                doThis(){
                    console.log("it is current event")
                }
            }
            
        })


    </script>
</body>
</html>